import random
import json

# 获取假数据，用户报表的展示
def get_product_data(start: int, end: int):
    data = {
        "dimensions":["product","能源趋势"],
        "source":[]
    }
    for i in range(1, 31):
        data['source'].append({
            'product': i,
            '能源趋势': random.randint(20, 150)
        })
    print(data)
    with open('product_data.json', 'w', encoding='utf-8') as f:
        json.dump(data, f, indent=4, ensure_ascii=False)

if __name__ == '__main__':
    get_product_data(0, 30)